#!/bin/sh
if [ -n "$1" ]; then
    data_date=$1
else
  data_date=$(data -d "-1 days" +%F)
fi



LOAD_DATA="
load data local inpath '/home/bwie/data/app.${data_date}.log'
    overwrite into table zg6_zk3_ods.ods_mall_log partition (dt='${data_date}');"


/opt/module/spark/bin/beeline -u jdbc:hive2://node101:10001 -n bwie -e "${LOAD_DATA}"
